#include <stdio.h>
#include <string.h>

typedef unsigned char *byte_pointer;

void show_bytes(byte_pointer start, int len){
    int i;\
    printf("[show bytes():] 0x");
    for(i = 0; i < len; i++){
        printf("%.2x ", start[i]);
    }
    printf("\n");
}

void show_int(int x){
    show_bytes((byte_pointer) &x, sizeof(int));
}

void show_float(float x){
    show_bytes((byte_pointer) &x, sizeof(float));
}

void show_double(double x){
    show_bytes((byte_pointer) &x,sizeof(double));
}

signed int main(){
    // int x = 12345;
    // printf("pointer of x = %p \n",  &x);
    // printf("pointer of x = %p \n",  (byte_pointer)(&x));
    // show_int(x);

    // int y = 5;
    // show_int(y);

    // float f = 2.125;
    // show_float(f);

    // double d = 123.456789;
    // show_double(d);

    // const char* s = "abcde";
    // show_bytes((byte_pointer)s, strlen(s) );

    int a1 = ~0x41;
    printf("~0x41:");
    show_int( a1 );

    return 0;
}

// gcc -o main main.c
